﻿//ssss
using System.Windows.Forms;


public partial class frmStockMateriales : frmBase
{
    public frmStockMateriales()
    {
        InitializeComponent();
    }
    //
    private void tcNavegadores_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
    {
        navBase oNavBase;
        int intIdNav;
        string strNombre, strText;
        //
        switch (tcNavegadores.SelectedTab.Key.ToLower())
        {
            case "cannabis": intIdNav = 10; strNombre = "navStockCannabis"; strText = "Stock Cannabis"; break;
            case "tinturas": intIdNav = 12; strNombre = "navStocktinturas"; strText = "Stock Tinturas"; break;
            case "materiales": intIdNav = 11; strNombre = "navStockmateriales"; strText = "Stock Materiales"; break;
            case "hachis": intIdNav = 13; strNombre = "navStockHachis"; strText = "Stock Hachis"; break;
            case "esquejes": intIdNav = 14; strNombre = "navEsquejes"; strText = "Stock Esquejes"; break;
            default: intIdNav = 0; strNombre = ""; strText = ""; break;
        }
        //
        if (intIdNav != 0)
        {
            object[] oArgs = new object[] { intIdNav }; //Argumentos para la instancia 
            oNavBase = (navBase)System.Reflection.Assembly.GetExecutingAssembly().CreateInstance(strNombre, true,
                                               System.Reflection.BindingFlags.CreateInstance, null, oArgs, null, null);
            if (oNavBase == null) { oNavBase = new navBase(intIdNav); } //Sino hay un navegaor específico... crear con el base
            oNavBase.Name = strNombre;
            oNavBase.Text = strText;
            oNavBase.TopLevel = false;
            oNavBase.Parent = tcNavegadores.Tabs[tcNavegadores.SelectedTab.Key].TabPage;
            oNavBase.FormBorderStyle = FormBorderStyle.None;
            oNavBase.Dock = DockStyle.Fill;
            oNavBase.ShowInTaskbar = false;
            oNavBase.Show();
        }
    }
}

